/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entity;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
import javax.persistence.*;
import javax.validation.constraints.NotNull;

/**
 *
 * @author HOME
 */
@Embeddable
public class RatesPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "BANK_REGION_ID")
    private BigInteger bankRegionId;
    @Basic(optional = false)
    @NotNull
    @Column(name = "CURRENCY_ID")
    private BigInteger currencyId;
    @Basic(optional = false)
    @NotNull
    @Column(name = "UPDATE_DATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date updateDate;

    public RatesPK() {
    }

    public RatesPK(BigInteger bankRegionId, BigInteger currencyId, Date updateDate) {
        this.bankRegionId = bankRegionId;
        this.currencyId = currencyId;
        this.updateDate = updateDate;
    }

    public BigInteger getBankRegionId() {
        return bankRegionId;
    }

    public void setBankRegionId(BigInteger bankRegionId) {
        this.bankRegionId = bankRegionId;
    }

    public BigInteger getCurrencyId() {
        return currencyId;
    }

    public void setCurrencyId(BigInteger currencyId) {
        this.currencyId = currencyId;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (bankRegionId != null ? bankRegionId.hashCode() : 0);
        hash += (currencyId != null ? currencyId.hashCode() : 0);
        hash += (updateDate != null ? updateDate.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RatesPK)) {
            return false;
        }
        RatesPK other = (RatesPK) object;
        if ((this.bankRegionId == null && other.bankRegionId != null) || (this.bankRegionId != null && !this.bankRegionId.equals(other.bankRegionId))) {
            return false;
        }
        if ((this.currencyId == null && other.currencyId != null) || (this.currencyId != null && !this.currencyId.equals(other.currencyId))) {
            return false;
        }
        if ((this.updateDate == null && other.updateDate != null) || (this.updateDate != null && !this.updateDate.equals(other.updateDate))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entity.RatesPK[ bankRegionId=" + bankRegionId + ", currencyId=" + currencyId + ", updateDate=" + updateDate + " ]";
    }
    
}
